﻿Public Class general

    Private Sub general_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        If My.Settings.HIBER = "FALSE" Then
            Switch_hibernate.pb_switch.Image = My.Resources.switch_1
            Switch_hibernate.on_off = 1
            Switch_hibernate.one_to_four = 4
        End If
        If My.Settings.SLEEP = "FALSE" Then
            Switch_sleep.pb_switch.Image = My.Resources.switch_1
            Switch_sleep.on_off = 1
            Switch_sleep.one_to_four = 4
        End If





        If My.Settings.HIBER = "TRUE" Then
            Switch_hibernate.pb_switch.Image = My.Resources.switch_4
            Switch_hibernate.on_off = 0
            Switch_hibernate.one_to_four = 1
        End If
        If My.Settings.SLEEP = "TRUE" Then
            Switch_sleep.pb_switch.Image = My.Resources.switch_4
            Switch_sleep.on_off = 0
            Switch_sleep.one_to_four = 1
        End If
    End Sub

    Private Sub on_off_timer_Tick(sender As Object, e As EventArgs) Handles on_off_timer.Tick
        Select Case Switch_hibernate.on_off
            Case 0
                My.Settings.HIBER = "TRUE"
                lbl_hibernate.Text = "On"                
            Case 1
                My.Settings.HIBER = "FALSE"
                lbl_hibernate.Text = "Off"
        End Select
        Select Case Switch_sleep.on_off
            Case 0                
                My.Settings.HIBER = "TRUE"
                lbl_sleep.Text = "On"
            Case 1
                My.Settings.HIBER = "FALSE"
                lbl_sleep.Text = "Off"
        End Select
    End Sub

    Private Sub NumericUpDown1_ValueChanged(sender As Object, e As EventArgs) Handles NumericUpDown1.ValueChanged
        My.Settings.INACTIV = NumericUpDown1.Value * 60
    End Sub
End Class
